package com.lw.function;

import java.util.function.Consumer;

/**
 * @author LW
 * @2020/8/21 9:40
 */

/**
 * Consumer  消费型接口：  只有输入  ，没有返回值
 */
public class ConsumerDemo {

    public static void main(String[] args) {
        //void没有返回值
        Consumer<Integer> consumer = new Consumer<Integer>() {
            @Override
            public void accept(Integer i) {
                System.out.println(i);
            }
        };
        Consumer<Integer> consumer1 = (i)->{
            System.out.println(i);
        };
        consumer.accept(1000);
        consumer.accept(100);
    }
}
